Skip to content

Conversation

@manzt
Copy link
Collaborator

@manzt manzt commented Aug 20, 2025

Adds initial boilerplate to connect DAP with marimo-lsp. The VS Code extension now forwards DAP messages over LSP, which has access to the session state as well as the document workspace.

Screen.Recording.2025-08-20.at.5.32.05.PM.mov

@manzt manzt marked this pull request as ready for review August 20, 2025 21:35
Comment on lines +72 to +82
const disposer = client.onNotification(
"marimo/dap",
({ sessionId, message }) => {
Logger.debug("Debug.Receive", "Received DAP response from LSP", {
sessionId,
message,
});
if (sessionId === session.id) {
sendMessage.fire(message);
}
},
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Responses from the request handler.

Comment on lines +92 to +97
executeCommand(client, {
command: "marimo.dap",
params: {
sessionId: session.id,
notebookUri: session.configuration.notebookUri,
message,
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom LSP "command" that wraps a DAP request with additional information (for a request). I assume that the handler will manage its own debug sessions.

"""Command-specific arguments. Should be parsed further in ./debug_adapter.py"""


def handle_debug_adapter_request(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

barebones request/response. I assume this is where your large conditional thing would go @dmadisetti

@manzt manzt changed the title Add Debug Adapter Protocol (DAP) support to marimo LSP Add Debug Adapter Protocol (DAP) support Aug 20, 2025
@manzt manzt force-pushed the push-klosomrynunw branch from 452fbcc to cb0d170 Compare August 21, 2025 13:58
@manzt manzt force-pushed the main branch 2 times, most recently from 5e534ff to f1de986 Compare August 21, 2025 14:05
@manzt manzt force-pushed the push-klosomrynunw branch from cb0d170 to a177e13 Compare August 21, 2025 14:20
@dmadisetti
Copy link

I'm going to make a PR to this PR- but we can sync Monday for upstream merge

@manzt
Copy link
Collaborator Author

manzt commented Aug 25, 2025

I just merged some linting/formatting changes in #6 for the extension code. Would I be able to rebase this branch cleanly for you?

@dmadisetti
Copy link

I might get up my pwn branch and close this out. Will manage rebase issues, but ping you if something seems to hairy.

Thanks again!

@manzt
Copy link
Collaborator Author

manzt commented Aug 25, 2025

Can we just squash this into main then? Or are your changes a significant departure from this? It would be nice to break up the DAP stuff into separate PRs I think so it's easier to review.

Copy link

@dmadisetti dmadisetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy getting this into main if you are!

Enables debugging marimo notebooks in VS Code by forwarding DAP messages
between the VS Code debugger and the LSP server. Just a stub now to
wire up everything.
@manzt manzt force-pushed the push-klosomrynunw branch from 1a6a560 to 6484853 Compare August 25, 2025 18:45
@manzt manzt merged commit df58cdf into main Aug 25, 2025
4 checks passed
@manzt
Copy link
Collaborator Author

manzt commented Aug 25, 2025

Cool, I merged

@manzt manzt deleted the push-klosomrynunw branch August 26, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants